<?php
/**
 * Created by PhpStorm.
 * User: 18048
 * Date: 2018/5/14
 * Time: 14:31
 */
$client = new swoole_client(SWOOLE_SOCK_TCP);
if(!$client->connect('127.0.0.1',9502,-1))
{
    exit("connect failed. Error:{$client->errCode}\n");
}
$client->send("hello world\n");
echo $client->recv();
$client->close();